package cn.emall.controller;

import cn.emall.config.JwtProperties;
import cn.emall.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import utils.ResponseBean;
import utils.ResultCode;

/**
 * @author Allen_HJL
 * @version 1.0
 * @date 2020/9/13 21:42
 */
@RestController
@RequestMapping("/category")
@Api(value = "商品类别接口")
public class CategoryController {
    @Autowired
    private JwtProperties jwtProperties;

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/getAllCategorys")
    @ApiOperation(value = "获得商品类别信息", notes = "直接获得")
    public ResponseBean getAllCarts(){
        System.out.println("getAllCategorys！！！");
        return ResponseBean.success(ResultCode.FIND_MANYDATA_SUCCESS,categoryService.list());
    }

}
